home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-09-28 | 2.4 KB | 76 lines |
- '***************************
- '* AMOS Professional *
- '* *
- '* MENUS 2 *
- '* * Menu structures and hierarchy
- '* (c) Europress Software *
- '* *
- '* Ronnie Simpson *
- '***************************
- '
- '-------------------------------------------
- 'SETTING UP SUB-OPTIONS
- '-------------------------------------------
- 'In the first tutorial a simple menu was created with the commands
- '
- '
- ' Menu$(3)="COLOUR" (title)
- ' Menu$(3,1)="RED" (first option)
- ' Menu$(3,2)="GREEN" (second option)
- ' etc...etc....
- '
- 'Sub options are generated (in a similar manner to arrays) by expanding
- 'the number of parameters given:-
- '
- ' Menu$(3,1,1)="LIGHT"
- ' Menu$(3,1,2)="DARK"
- ' Menu$(3,2,1)="LIGHT"
- ' Menu$(3,2,2)="DARK"
- ' etc...etc....
- '
- 'Each level is represented by its separate element and each is controlled
- 'with its own Menu$ instruction.
- '
- 'Up to a maximum of 8 levels can be generated.
- '
- '
- '-------------------------------------------
- 'WORKING EXAMPLE
- '-------------------------------------------
- Rem *** tidy up the screen
- '
- Screen Open 0,640,200,16,Hires
- Palette $0,$F00,$F0,$F,$DAF,$F0F,$FF,$F70,$7F,$70F,$F07,$333,$666,$999,$CCC,$FFF
- Flash Off : Curs Off : Cls 0 : Pen 7 : Paper 0
- '
- Rem *** set up a large menu
- '
- Pen 4 : Locate 0,9 : Cline : Centre "PLEASE WAIT WHILE I SET UP A LARGE MENU......."
- For TITLE=1 To 5
- Menu$(TITLE)="TITLE"+Str$(TITLE)+" "
- For OPTION=1 To 10
- Menu$(TITLE,OPTION)="OPTION"+Str$(OPTION)
- For SUB1=1 To 5
- Menu$(TITLE,OPTION,SUB1)="SUB OPTION A"+Str$(SUB1)
- For SUB2=1 To 3
- Menu$(TITLE,OPTION,SUB1,SUB2)="SUB OPTION B"+Str$(SUB2)
- Next
- Next
- Next
- Next
- Menu On
- '
- Pen 1 : Locate 0,23 : Centre "PRESS LEFT MOUSE KEY TO QUIT"
- Pen 4 : Locate 0,9 : Cline : Centre "PRESS RIGHT MOUSE KEY TO SEE MENU"
- '
- Rem *** start the main loop
- '
- Do
- Repeat : M=Mouse Key : Until M>0
- If M=1 Then Edit
- While Choice : Wend
- Pen 6 : Locate 0,14 : Centre "To read this menu and cover every eventuality would require"
- Locate 0,15 : Centre "an enormous amount of if....then tests, the next program in the"
- Locate 0,16 : Centre "series deals with easier ways of reading menus automatically."
- Loop
- Wait Key